<template>
  <w-tr :folder="data.folder" :success="success" :data="data">
    <template #default>
      <w-td align="center">{{data.id}}</w-td>
      <w-td><w-leaf :text="data.name"/></w-td>
      <w-td>{{data.address}}</w-td>
    </template>
    <template #rows>
      <tmpl-tr v-for="item in children" :key="item.id" :data="item"/>
    </template>
  </w-tr>
</template>

<script>
  export default {
    name: 'tmpl-tr',
    props: ['data'],
    data() {
      return {
        children: this.data.children
      }
    },
    methods: {
      success(data) {
        this.children = data.data
      }
    }
  }
</script>

<style>
</style>
